@import './base.css';

/*
 * 全局样式定义
 */

/* CSS 变量：主题颜色和样式 */
:root {
  /* 基础颜色 */
  --primary-color: #12b8f6;
  --primary-gradient: linear-gradient(135deg, #12b8f6, #6dd5fb);
  --success-color: #34c759;
  --success-gradient: linear-gradient(135deg, #34c759, #7ad97f);
  --warning-color: #ff9500;
  --warning-gradient: linear-gradient(135deg, #ff9500, #ffb74d);
  --danger-color: #ff3b30;
  --danger-gradient: linear-gradient(135deg, #ff3b30, #ff6b6b);
  --info-color: #5856d6;
  --info-gradient: linear-gradient(135deg, #5856d6, #8a89e6);

  /* 文本颜色 */
  --text-primary: #333333;
  --text-regular: #5a6a85;
  --text-secondary: #8c9db5;
  --text-placeholder: #b0b0b0;

  /* 背景颜色 */
  --bg-color: #f5f7fa;
  --bg-color-overlay: #ffffff;

  /* 边框颜色 */
  --border-color: #dcdfe6;
  --border-color-light: #e4e7ed;

  /* 圆角 */
  --border-radius-small: 6px;
  --border-radius: 6px;
  --border-radius-large: 6px;
  --border-radius-circle: 50%;

  /* 阴影 */
  --shadow-small: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-regular: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-large: 0 8px 24px rgba(0, 0, 0, 0.15);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.18);

  /* 动画 */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.25s ease-in-out;
  --transition-slow: 0.4s ease-in-out;
  --animation-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* 毛玻璃效果 */
  --glass-background: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-blur: 12px;
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 暗色主题变量 */
.dark {
  /* 基础颜色保持不变，以保持品牌一致性 */

  /* 文本颜色 */
  --text-primary: #ffffff;
  --text-regular: rgba(255, 255, 255, 0.85);
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-placeholder: rgba(255, 255, 255, 0.45);

  /* 背景颜色 */
  --bg-color: #121212;
  --bg-color-overlay: #1e1e1e;

  /* 边框颜色 */
  --border-color: #434343;
  --border-color-light: #303030;

  /* 阴影 */
  --shadow-small: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-regular: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-large: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.4);

  /* 毛玻璃效果 */
  --glass-background: rgba(30, 30, 30, 0.85);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-blur: 12px;
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

/* 全局基础样式 */
html,
body {
  margin: 0;
  padding: 0;
  font-family:
    'Inter', 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    '微软雅黑', Arial, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  transition: background var(--transition-fast);
}

.dark ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* 滚动容器样式 */
.scrollable-container {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.dark .scrollable-container {
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

/* 毛玻璃卡片样式 */
.glass-card {
  background-color: var(--glass-background);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--border-radius);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.glass-card:hover {
  box-shadow: var(--shadow-hover);
}

.dark .glass-card:hover {
  box-shadow: var(--shadow-hover);
}

/* 毛玻璃面板 */
.glass-panel {
  background-color: var(--glass-background);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--border-radius);
  transition: all var(--transition-normal);
  overflow: hidden;
}

/* 淡入动画 */
.fade-in {
  animation: fadeIn var(--transition-normal) forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 上浮动画 */
.float-up {
  animation: floatUp var(--transition-normal) var(--animation-bounce) forwards;
}

@keyframes floatUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 缩放动画 */
.scale-in {
  animation: scaleIn var(--transition-normal) var(--animation-bounce) forwards;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 页面切换动画 */
.fade-transform-enter-active,
.fade-transform-leave-active {
  transition: all var(--transition-normal);
}

.fade-transform-enter-from {
  opacity: 0;
  transform: translateX(20px);
}

.fade-transform-leave-to {
  opacity: 0;
  transform: translateX(-20px);
}

/* Element Plus 组件样式覆盖 */
.el-card {
  border-radius: var(--border-radius);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-regular) !important;
  background-color: var(--glass-background);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  overflow: hidden;
  transition: all var(--transition-normal);
}

.el-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover) !important;
}

.dark .el-card:hover {
  box-shadow: var(--shadow-hover) !important;
}

.el-card__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  background-color: rgba(255, 255, 255, 0.05);
}

.dark .el-card__header {
  background-color: rgba(0, 0, 0, 0.2);
}

/* 表格样式 */
.el-table {
  background-color: transparent !important;
  border-radius: 8px;
  overflow: hidden;
}

.el-table::before {
  display: none;
}

.el-table th.el-table__cell {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-bottom: 1px solid var(--border-color);
}

.dark .el-table th.el-table__cell {
  background-color: rgba(0, 0, 0, 0.2) !important;
}


.el-table td.el-table__cell,
.el-table th.el-table__cell.is-leaf {
  border-bottom: 1px solid var(--border-color-light);
}

.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
  background-color: rgba(0, 0, 0, 0.02);
}

.dark .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
  background-color: rgba(255, 255, 255, 0.05);
}

.el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

.dark .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

/* 表单样式 */
.el-form-item__label {
  color: var(--text-regular);
}

.el-input__wrapper,
.el-textarea__wrapper {
  background-color: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-color);
  box-shadow: none !important;
  transition: all 0.3s;
}

.dark .el-input__wrapper,
.dark .el-textarea__wrapper {
  border: 1px solid var(--border-color);
}

.el-input__wrapper:hover,
.el-textarea__wrapper:hover {
  border-color: var(--primary-color);
}

.el-input__wrapper.is-focus,
.el-textarea__wrapper.is-focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 1px var(--primary-color) !important;
}

/* 分页样式 */
.el-pagination.is-background .el-pager li:not(.disabled).active {
  background-color: var(--primary-color);
}

.el-pagination.is-background .el-pager li:not(.disabled):hover {
  color: var(--primary-color);
}

/* 按钮样式 */
.el-button {
  transition: all var(--transition-normal);
}

.el-button--primary {
  background: var(--primary-gradient) !important;
  border: none !important;
}

.el-button--success {
  background: var(--success-gradient) !important;
  border: none !important;
}

.el-button--warning {
  background: var(--warning-gradient) !important;
  border: none !important;
}

.el-button--danger {
  background: var(--danger-gradient) !important;
  border: none !important;
}

.el-button--info {
  background: var(--info-gradient) !important;
  border: none !important;
}

.el-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-small);
}

.el-button:active {
  transform: translateY(0);
}

/* 其他全局样式 */
a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  color: rgba(26, 115, 232, 0.8);
  text-decoration: none;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-20 {
  margin-bottom: 20px;
}

.mt-10 {
  margin-top: 10px;
}

.mt-20 {
  margin-top: 20px;
}

.p-20 {
  padding: 20px;
}
